<%@ page language="java" pageEncoding="UTF-8"%>

<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html:html lang="true">
  <head>
    <html:base />
    
    <title>SoftwareInfoEdit.jsp</title>

	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/resources/css/ext-all.css"/>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/ext-base.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/ext-all.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/ext-lang-zh_CN.js"></script>
<script type="text/javascript">
<!--
Ext.onReady(function(){
	
	var formAction='${pageContext.request.contextPath}/softwareInfo.html?action=save';
	
    var propsGrid = new Ext.grid.PropertyGrid({
    	title:'表单asdfasd',
        el:'softwareInfoFormDiv',
        width:300,
        autoHeight:true,
        viewConfig : {
            forceFit:true,
            scrollOffset:2 // the grid will never have scrollbars
        }
    });

    propsGrid.render();

    propsGrid.setSource({
        "grouping": false,
        "autoFitColumns": true,
        "productionQuality": false,
        "created": new Date(Date.parse('2008/5/3')),
        "tested": false,
        "version": .01,
        "borderWidth": 1
    });
   
   var bd = Ext.getBody();
    
    bd.createChild({tag: 'h2', html: 'Form 3 - A little more complex'});


    var top = new Ext.FormPanel({
        labelAlign: 'top',
        frame:true,
        title: 'Multi Column, Nested Layouts and Anchoring',
        bodyStyle:'padding:5px 5px 0',
        width: 600,
        items: [{
            layout:'column',
            items:[{
                columnWidth:.5,
                layout: 'form',
                items: [{
                    xtype:'textfield',
                    fieldLabel: 'First Name',
                    name: 'first',
                    anchor:'95%'
                }, {
                    xtype:'textfield',
                    fieldLabel: 'Company',
                    name: 'company',
                    anchor:'95%'
                }]
            },{
                columnWidth:.5,
                layout: 'form',
                items: [{
                    xtype:'textfield',
                    fieldLabel: 'Last Name',
                    name: 'last',
                    anchor:'95%'
                },{
                    xtype:'textfield',
                    fieldLabel: 'Email',
                    name: 'email',
                    vtype:'email',
                    anchor:'95%'
                }]
            }]
        },{
            xtype:'htmleditor',
            id:'bio',
            fieldLabel:'Biography',
            height:200,
            anchor:'98%'
        }],

        buttons: [{
            text: '确定'
        },{
            text: '重置'
        }]
    });

    top.render(document.body);
    
    var form=new Ext.form.FormPanel({
    	defaultType:'textfield',
    	labelAlign:'right',
    	title:'form',
    	labelWidth:50,
    	frame:true,
    	width:220,
    	
    	items:[{
    		fieldLabel:'文本框',
    		name:'name'
    	}],
    	buttons:[{
    		text:'按钮',
    		handler: function(){
            	form.getForm().submit({url:formAction, waitMsg:'Saving Data...'});
            	location.href="${pageContext.request.contextPath}/softwareInfo.html?action=list";
        	}
    	}]
    });
    
    form.render(document.body);
    
    var form1 = new Ext.form.FormPanel({
        baseCls: 'x-plain',
        layout:'absolute',
        url:'save-form.php',
        defaultType: 'textfield',

        items: [{
            x: 0,
            y: 5,
            xtype:'label',
            text: 'Send To:'
        },{
            x: 60,
            y: 0,
            name: 'to',
            anchor:'100%'  // anchor width by percentage
        },{
            x: 0,
            y: 35,
            xtype:'label',
            text: 'Subject:'
        },{
            x: 60,
            y: 30,
            name: 'subject',
            anchor: '100%'  // anchor width by percentage
        },{
            x:0,
            y: 60,
            xtype: 'textarea',
            name: 'msg',
            anchor: '100% 100%'  // anchor width and height
        }]
    });

    var window = new Ext.Window({
        title: 'Resize Me',
        width: 500,
        height:300,
        minWidth: 300,
        minHeight: 200,
        layout: 'fit',
        plain:true,
        bodyStyle:'padding:5px;',
        buttonAlign:'center',
        items: form1,

        buttons: [{
            text: 'Send'
        },{
            text: 'Cancel'
        }]
    });

    window.show();
    
    var simple = new Ext.form.FormPanel({
        labelWidth: 55, // label settings here cascade unless overridden
        frame:true,
        bodyStyle:'padding:5px 5px 0',
        width: 230,
        defaults: {width: 120},
        defaultType: 'textfield',
        renderTo: 'div_search',

        items: [{
                fieldLabel: searchLabel,
                name: 'keyword',
                id:'keyword',
                allowBlank:true
            },new SearchComboBox({
                hiddenName: 'scope',
                url: './builder.do?button(loadFields)&field(entity)='+config.entity,
                emptyText:scopeLabel,
                label:scopeLabel
            })
        ],

        buttons: [{
            text: searchButtonText,type:'submit',
            handler: function(e){
                simple.submit();
            }
        }],

        onSubmit: Ext.emptyFn,
        submit: function() {
            var form = simple.getForm().getEl().dom;
            form.action = formAction;
            form.target='master_list';
            form.submit();
        }
    });
    
    simple.render(document.body);
    
});
//-->
</script>
  </head>
  
  <body>
  	<div id="softwareInfoFormDiv"></div>
  	<div id="div_search"></div>
  </body>
</html:html>
